﻿CREATE PROCEDURE [dbo].[ReportEmployeeTravel]
@startDate DATETIME, @endDate DATETIME
AS
BEGIN
	SELECT     EntryLog.EntryDate, Users.FullName, Projects.Name
	FROM         EntryLog INNER JOIN
                      Projects ON EntryLog.ProjectID = Projects.ProjectID INNER JOIN
                      Users ON EntryLog.UserID = Users.UserID
	WHERE     (EntryLog.OvernightStay = 1) AND (EntryLog.EntryDate >= @startDate) AND (EntryLog.EntryDate <= @endDate)
	ORDER BY Users.FullName
END

